$(function(){
		$('.gallery-image').click(function(){
			$(".curr_gallery_img").removeClass("curr_gallery_img");
			$(this).addClass("curr_gallery_img");
			var parent = $(this).parent();
			update_modal(parent);
		});
		$(".next-arrow").click(function(){
			show_next();
		});
		$(".prev-arrow").click(function(){
			show_prev();
		});	
		$("img.lazy").lazyload();
		$(".page-gallery-wrapper").css("min-height",$(window).innerHeight()-$("#page-header").innerHeight());
	});
	function update_modal(parent)
	{		
		$('#share_pic').attr('src','upload/standard/'+parent.attr('data-attr-pic'));		
		$('#share_msg').html(parent.attr('data-attr-mmsg'));
		$('#share_name').html(parent.attr('data-attr-name').toUpperCase());
		if($('.curr_gallery_img').parent().next().length == 0)
		{
			$(".next-arrow").hide();
		}
		else
		{
			$(".next-arrow").show();
		}
		if($('.curr_gallery_img').parent().prev().length == 0)
		{
			$(".prev-arrow").hide();
		}
		else
		{
			$(".prev-arrow").show();
		}
	}
	